<div class="scroller" style="margin:4px;">
	<ul class="list">
		<li id="dosearch{{identify}}" class="elemsole" style="cursor:pointer;"><h2><img src="images/user_24.png" class="img-responsive img-rounded img-size-16"/>高级搜索</h2></li>
		<li id="searchcontent{{identify}}" class="padding-top-sm whitebackground" style="display:none;">
        	<ul id="categorytabbar{{identify}}" class="list" style="padding:0px;margin:0px;">
				<li style="padding:0px;">
					<div class="divline">
						<div class="row tabbar" style="clear:both;display:block;">
							<div class="col-xs-4" ><a href="javascript:void(0);" group-type="category">类型</a></div>
							<div class="col-xs-4 persist"><a href="javascript:void(0);" group-type="belong">属地</a></div>
							<div class="col-xs-4"><a href="javascript:void(0);" group-type="credit">信誉</a></div>
						</div>
					</div>
				</li>
           			<li class="combackground controlgroup category">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="" id="checkbox-a{{identify}}">
	    			<label for="checkbox-a{{identify}}">全部</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup category">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="0" id="checkbox-0a{{identify}}">
	    			<label for="checkbox-0a{{identify}}">冻品</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup category">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="1" id="checkbox-1a{{identify}}">
	    			<label for="checkbox-1a{{identify}}">干货</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup category">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="2" id="checkbox-2a{{identify}}">
	    			<label for="checkbox-2a{{identify}}">活鲜</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup category">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="3" id="checkbox-3a{{identify}}">
	    			<label for="checkbox-3a{{identify}}">水果</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup category last">
           				<a href="javascript:void(0);">
           					<input type="checkbox" name="checkbox-type" value="4" id="checkbox-4a{{identify}}">
	    			<label for="checkbox-4a{{identify}}">调料</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup belong">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-area" id="checkbox-0b{{identify}}" value="">
            				<label for="checkbox-0b{{identify}}">全部</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup belong">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-area" id="checkbox-1b{{identify}}" value="上海">
            				<label for="checkbox-1b{{identify}}">上海</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup belong">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-area" id="checkbox-2b{{identify}}" value="北京">
            				<label for="checkbox-2b{{identify}}">北京</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup belong last">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-area" id="checkbox-3b{{identify}}" value="深圳">
            				<label for="checkbox-3b{{identify}}">深圳</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup credit">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-credit" id="checkbox-0c{{identify}}" value="">
	    			<label for="checkbox-0c{{identify}}">全部</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup credit">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-credit" id="checkbox-1c{{identify}}" value="1">
	    			<label for="checkbox-1c{{identify}}">信誉好</label>
           				</a>
           			</li>
           			<li class="combackground controlgroup credit last">
           				<a href="javascript:void(0);">
            				<input type="checkbox" name="checkbox-credit" id="checkbox-2c{{identify}}" value="0">
	    			<label for="checkbox-2c{{identify}}">信誉一般</label>
           				</a>
           			</li>
       			</ul>
		</li>
	</ul>
</div>
<div style="margin:0px 6px;">
	<form role="form">
		<div class="form-group" style="margin-bottom:0px;">
			<input type="text" class="form-control" id="search" placeholder="产品关键字（至少两个）">
		</div>
	</form>
</div>
<div class="scroller" style="margin:4px;">
	<ul class="list" id="myproductlist{{identify}}" saleType="{{saleType}}"></ul>
	<button type="button" id="loadmore{{identify}}" class="btn btn-default btn-lg btn-block" style="margin-top:5px;">加载更多</button>
</div>
<script type="text/javascript">
	Global.loading();
	function loadItems{{identify}}(params) {
		$.ajax({
			type: 'GET',
	    	url: GLOBAL_CONTEXT_PATH + '/product/listJsonItems.html?product.saleType={{saleType}}',
	    	dataType: 'json',
	    	data: params,
	    	crossDomain: true,
	    	success: function (data){
// 	    		$('#myproductlist{{identify}}').html(Global.loadFragment('listitems', data));
	    		$('#myproductlist{{identify}}').append(Global.loadFragment('listitems', data));
	            Global.setItem("listitems{{saleType}}", data);
	    		Global.loaded();
	    	},
	    	error:function(msg) {
	    		if (!app.checkConnection()) {
	    		}
	        	$('#myproductlist{{identify}}:empty').html(Global.loadFragment('listitems', Global.getItem("listitems{{saleType}}")));
	    		Global.loaded();
	    	}
		});
	}
	loadItems{{identify}}({});
	$('#loadmore{{identify}}').click(function() {
		var last = $('#myproductlist{{identify}} li:last');
		if (last.length > 0) {
			var dataCreated = last.attr('timestamp');
			if (!dataCreated) {//如果没有取到dataCreated字段，就直接返回不做任何处理。
				return;
			}
			loadItems{{identify}}({
				'product.dateCreated': dataCreated.replace(/T/ig, ' '),
				'itemcount': $('#myproductlist{{identify}} li').length,
				'itemaction': 'up'
			});
		}
	});
	$('#dosearch{{identify}}').click(function() {
		var $this = $(this);
		$this.toggleClass('elemsole');
		$('#searchcontent{{identify}}').toggle();
	});
	var root{{identify}} = $('#categorytabbar{{identify}}');
	root{{identify}}.find('input[type="checkbox"]').myallcheckbox();
	root{{identify}}.find('div.col-xs-4').each(function() {
		var $this = $(this);
		$this.find('a:first').click(function(e) {
			e.preventDefault();
			var $a = $(this);
			var group = $a.attr('group-type');
// 			var root = $('#categorytabbar{{identify}}');
			root{{identify}}.find('div.col-xs-4').removeClass('persist');
			root{{identify}}.find('li.controlgroup').hide();
			root{{identify}}.find('li.' + group).show();
			$a.parent().addClass('persist');
		});
	}).first().find('a').click();
	<{{!}}/script>